package project1;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;

/**
 *  @author Andrew O'Connor
 *  COSC 603
 *  Project 1
 */
public class Main {

    public static void main(String[] args) {

        if(args.length == 0) {
            System.out.println("proper usage is: java project1.Main filename");
            System.exit(0);
        }

        String file_name = String.valueOf(args[0]);

        ReadTextFile reader = new ReadTextFile(StandardCharsets.UTF_8);

        List<String> input = reader.readSmallTextFile(file_name);

        List<Character> filter = Arrays.asList(',', '.', '!', '-', '+', '=', ';', ':', '?', '&', '{', '}', '\\');

        CleanInput cleaner = new CleanInput(filter);

        List<String> clean_input = cleaner.clean(input);

        FindRepeatedWords finder = new FindRepeatedWords(clean_input);

        finder.findRepeats();

        finder.printRepeats();
    }
}
